# Copyright 2024 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

# Examples

pw_cc_test(
    name = "bitset",
    srcs = ["bitset.cc"],
    deps = [
        "//pw_assert:assert",
        "//pw_containers:bitset",
    ],
)

pw_cc_test(
    name = "flat_map",
    srcs = ["flat_map.cc"],
    deps = ["//pw_containers:flat_map"],
)

pw_cc_test(
    name = "intrusive_forward_list",
    srcs = ["intrusive_forward_list.cc"],
    deps = ["//pw_containers:intrusive_forward_list"],
)

pw_cc_test(
    name = "intrusive_list",
    srcs = ["intrusive_list.cc"],
    deps = ["//pw_containers:intrusive_list"],
)

pw_cc_test(
    name = "intrusive_map",
    srcs = ["intrusive_map.cc"],
    features = ["-conversion_warnings"],
    deps = ["//pw_containers:intrusive_map"],
)

pw_cc_test(
    name = "intrusive_multimap",
    srcs = ["intrusive_multimap.cc"],
    features = ["-conversion_warnings"],
    deps = ["//pw_containers:intrusive_multimap"],
)

pw_cc_test(
    name = "intrusive_set",
    srcs = ["intrusive_set.cc"],
    features = ["-conversion_warnings"],
    deps = ["//pw_containers:intrusive_set"],
)

pw_cc_test(
    name = "intrusive_multiset",
    srcs = ["intrusive_multiset.cc"],
    features = ["-conversion_warnings"],
    deps = ["//pw_containers:intrusive_multiset"],
)

pw_cc_test(
    name = "multiple_containers",
    srcs = ["multiple_containers.cc"],
    features = ["-conversion_warnings"],
    deps = [
        "//pw_containers:intrusive_list",
        "//pw_containers:intrusive_map",
        "//pw_result",
        "//pw_status",
    ],
)

pw_cc_test(
    name = "optional_tuple",
    srcs = ["optional_tuple.cc"],
    deps = ["//pw_containers:optional_tuple"],
)

pw_cc_test(
    name = "vector",
    srcs = ["vector.cc"],
    deps = [
        "//pw_containers:vector",
        "//pw_function",
        "//pw_status",
    ],
)

pw_cc_test(
    name = "wrapped_iterator",
    srcs = ["wrapped_iterator.cc"],
    deps = ["//pw_containers:wrapped_iterator"],
)

sphinx_docs_library(
    name = "docs",
    srcs = [
        "bitset.cc",
        "flat_map.cc",
        "intrusive_forward_list.cc",
        "intrusive_list.cc",
        "intrusive_map.cc",
        "intrusive_multimap.cc",
        "intrusive_multiset.cc",
        "intrusive_set.cc",
        "multiple_containers.cc",
        "optional_tuple.cc",
        "vector.cc",
        "wrapped_iterator.cc",
    ],
    target_compatible_with = incompatible_with_mcu(),
)
